package edu.bit.water.controller;

import edu.bit.water.entity.MetaEffluentLet;
import edu.bit.water.entity.MetaSensor;
import edu.bit.water.service.MetaEffluentLetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 废水排放元数据表的控制层
 *
 * @author HuJiShuang
 * @date 19.07.07
 */
@Controller
@RequestMapping("/meta_effluent_let")
public class MetaEffluentLetController {

    @Autowired
    private MetaEffluentLetService metaEffluentLetService;

    /**
     * @return 返回所有元数据表中的记录
     */
    @ResponseBody
    @RequestMapping(value = "/select/all", method = RequestMethod.GET)
    public String select() {
        return metaEffluentLetService.selectAll();
    }

    /**
     * @param metaEffluentLet 元数据表实体
     * @return 返回执行状态
     */
    @ResponseBody
    @RequestMapping(value = "/insert", method = RequestMethod.POST)
    public String insert(@RequestBody MetaEffluentLet metaEffluentLet) {
        return metaEffluentLetService.insert(metaEffluentLet);
    }

    /**
     * @param enNameList 英文名称集合
     * @return 返回执行状态
     */
    @ResponseBody
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public String delete(@RequestBody List<String> enNameList) {
        return metaEffluentLetService.delete(enNameList);
    }

    @ResponseBody
    @RequestMapping("/update")
    public Map<String, Object> updateMetaEffluentLet(MetaEffluentLet metaeffluentlet) {
        Map<String, Object> result = metaEffluentLetService.updateMetaEffluentLet(metaeffluentlet);
        return result;
    }
}


